﻿@{
    store.cyt369.com.models.StoreCategory storecategory = ViewBag.StoreCategory as store.cyt369.com.models.StoreCategory;
    int? categoryID = ViewBag.storescategoryID;
    int? area = ViewBag.area;
    int? cityID = ViewBag.cityID;
    List<store.cyt369.com.models.Base.City> citys = ViewBag.citys as List<store.cyt369.com.models.Base.City>;
}
<input type="hidden" id="parentCategoryID" value="@(storecategory==null?0:@storecategory.Id)" />
<input type="hidden" id="initCategoryID" value="@categoryID" />
<input type="hidden" id="initArea" value="@area" />
<input type="hidden" id="initCityID" value="@cityID" />

<div class="category-one">
    <p class="p1">行业</p>
    <p class="p2"><a href="" class="active"><span>不限</span></a></p>
    <p class="p3">
        @if (storecategory != null)
        {
            @if (storecategory.Childs != null)
                @foreach (var child in storecategory.Childs)
                {
                    <a href="javascript:void(0);" category="@child.Id" onclick="categoryChange(@child.Id)">
                        <span>@child.CategoryName</span>
                    </a>
                }
        }
        else
        {
            @* 搜索情况下，显示一级类别 *@
            IQueryable<store.cyt369.com.models.StoreCategory> allParentCategorys = ViewBag.allParentCategorys as IQueryable<store.cyt369.com.models.StoreCategory>;
            if (allParentCategorys != null)
            {
                @foreach (var c in allParentCategorys)
                {
                    <a href="javascript:void(0);" category="@c.Id" onclick="parentCategoryChange(@c.Id)">
                        <span>@c.CategoryName</span>
                    </a>
                }
            }
        }
    </p>
</div>

<!-- 区域 -->
<div class="category-one">
    <p class="p1">区域</p>
    <p class="p2"><a href="javascript:void(0)" class="active"><span id="span-city-0" class='@(cityID==0||cityID==null?"selected":"")'>不限</span></a></p>
    <p class="p3">
        @if (citys != null)
        {
            @foreach (var c in citys)
            {
                <a href="javascript:void(0)" onclick="cityChange(@c.Id)" >
                    <span id="span-city-@c.Id" class='@(c.Id==cityID?"selected":"")'>@c.CityName</span>
                </a>
            }
        }
    </p>
</div>

<!-- 面积 -->
<div class="category-one">
    <p class="p1">面积</p>
    <p class="p2"><a href="javascript:void(0)" class="active" onclick="amountChange(0)"><span class='@(area==0||area==null?"selected":"")'>不限</span></a></p>
    <p class="p3">
        <a href="javascript:void(0)" onclick="amountChange(1)"><span class='@(area==1?"selected":"")'>20平米以下</span></a>
        <a href="javascript:void(0)" onclick="amountChange(2)"><span class='@(area==2?"selected":"")'>20-50平米</span></a>
        <a href="javascript:void(0)" onclick="amountChange(3)"><span class='@(area==3?"selected":"")'>50-100平米</span></a>
        <a href="javascript:void(0)" onclick="amountChange(4)"><span class='@(area==4?"selected":"")'>100-200平米</span></a>
        <a href="javascript:void(0)" onclick="amountChange(5)"><span class='@(area==5?"selected":"")'>200-500平米</span></a>
        <a href="javascript:void(0)" onclick="amountChange(6)"><span class='@(area==6?"selected":"")'>500平米以上</span></a>
        <input style="width: 40px;">
        <span>-</span>
        <input style="width: 40px;">
        <button style="width: 40px;">确定</button>
    </p>
</div>

<div class="searchItem">
    <ul>
        <span style="margin-right: 10px;margin-left: 15px;font-size: 13px;">你正在查询</span>
        <div class="searchTag">
            "@(storecategory.Note)商铺"
            <span class="searchTagImg"></span>
        </div>
        <div id="newTagContainer" style="display:none;"></div>
    </ul>
</div>